#!/bin/bash
echo "please input the directory that need to backup: "
read a 
if [ -d "$a" ];then
echo "the file directory exists!"
else
echo "the file directory does not exist!"
exit 0
fi
echo "backup file directory:"
read b
if [ -d "$b" ];then
echo "the file directory exists!"
else 
echo "the file directory does not exist!"
exit 0
fi

bakFile=`date +%Y%m%d`

tar -czpvf ${b}/${bakFile}.tar.gz ${a}

